<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width= , initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <div id="app">
       <ul>
           <li v-for="item in names">{{item}}</li>
       </ul>
        
       <ul>
        <li v-for="(item , index) in names">
            {{index + 1}}.{{item}}</li>
       </ul>

       <!-- 遍历对象 -->
       <ul>
        <li v-for="item in info">
            {{item}}</li>
       </ul>
       <!-- 获取key -->
       <ul>
        <li v-for="(value , key) in info">
            {{key}}=={{value}}</li>
       </ul>
        <!-- 获取key 和  index -->
        <ul>
            <li v-for="(value , key , index) in info">
                {{key}}=={{value}}=={{index}}</li>
           </ul>
    </div>
    <script src="../js/vue.js"></script>
    <script>
        // 小问题： 切换时input框里的数据不会消失  vue底层元素复用，为了性能
         const app = new Vue({
            el: '#app',    
            data: {    
                names: ['aaa','bbb','ccc','ddd'],
                info: {
                    name: 'why',
                    age: 18,
                    height: 1.88
                }
            }
        })
    </script>
</body>
</html>